package me.zhengjie.modules.system.service.mapstruct;

import me.zhengjie.base.BaseMapper;
import me.zhengjie.modules.system.domain.SafeRiskCase;
import me.zhengjie.modules.system.service.dto.SafeRiskCaseDto;
import me.zhengjie.modules.system.service.mapstruct.convertor.impl.SafeRiskCaseConvertor;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

/**
 * SafeRiskTypeMapper
 *
 * @author guoyuan
 * @version 1.0.0
 * @since 1.0.0
 */
@Mapper(componentModel = "spring", uses = {SafeRiskCaseConvertor.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface SafeRiskCaseMapper extends BaseMapper<SafeRiskCaseDto, SafeRiskCase> {
    /**
     * DTO转Entity
     *
     * @param dto /
     * @return /
     */
    @Override
    @Mapping(target = "sceneType", source = "sceneType", qualifiedByName = "sceneType2Code")
    SafeRiskCase toEntity(SafeRiskCaseDto dto);

    /**
     * Entity转DTO
     *
     * @param entity /
     * @return /
     */
    @Override
    @Mapping(target = "sceneType", source = "sceneType", qualifiedByName = "sceneType2Value")
    SafeRiskCaseDto toDto(SafeRiskCase entity);
}
